<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>欢迎登录</title>
<style>
<!--登录页面的CSS-->
body{background-color:#eee;margin:0;padding:0;}
.reg{width:500px;margin:15px auto;padding:20px;border:1px solid #ccc;background-color:#fff;}
.reg .title{text-align:center;padding-bottom:10px;}
.reg th{font-weight:normal;text-align:right;}
.reg input{width:180px;border:1px solid #ccc;height:20px;padding-left:4px;}
.reg .button{background-color:#0099ff;border:1px solid #0099ff;color:#fff;width:80px;height:25px;margin:0 5px;cursor:pointer;}
.reg .td-btn{text-align:center;padding-top:10px;}
.reg .td-auto-login{font-size:14px;text-align:left;padding-left:90px;padding-top:5px;}
.reg .checkbox{width:auto;vertical-align:middle;}
.reg label{vertical-align:middle;}
.reg img {vertical-align:top;}
.reg a{font-size:12px; color:#999; text-decoration:none;}
</style>
</head>
<body>
<form method="post" action="doLogin.php">
<fieldset class="reg">
		<legend>用户登录</legend>
  <table >	 
	<tr><th>用户名：</th><td><input type="text" name="username" /></td></tr>
	<tr><th>密码：</th><td><input type="password" name="password" /></td></tr>
    <tr><th>验证码：</th><td><input type="text" name="verify_code" />	<img src="common/code.php" alt="" id="code_img"/>  
				<a href="#" id="change">看不清，换一张</a> </td>  
    </tr>
	<tr><td colspan="2" class="td-auto-login">
		<input type="checkbox" class="checkbox" id="auto_login" name="auto_login" value="on" />
        <label for="auto_login">下次自动登录</label>
	</td></tr>
	<tr><td colspan="2" class="td-btn">
	<input type="submit" value="登录" class="button" />
	<input type="button" value="立即注册" class="button" onclick="location.href='register.php'" />
	</td></tr>
</table>
</fieldset>	
</form>
<script>
	var change = document.getElementById("change");
	var img = document.getElementById("code_img");
	change.onclick = function(){
		img.src = "common/code.php?t="+Math.random(); //增加一个随机参数，防止图片缓存
		return false; //阻止超链接的跳转动作
	}
</script>
</body>
</html>